import time

from selenium import webdriver
from selenium.webdriver.common.by import By
# from selenium.webdriver.support.wait import WebDriverWait
# from selenium.webdriver.support import expected_conditions as EC



from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC



driver=webdriver.Edge()
driver.get('https://www.baidu.com/')
time.sleep(3)
# driver.implicitly_wait(10)
driver.find_element(By.CLASS_NAME,'soutu-btn').click()
time.sleep(2)


driver.find_element(By.CLASS_NAME,'upload-pic').send_keys(r"C:\Users\lenovo\Pictures\Screenshots\73ba71d0b11d3b5d1ccd42391d99e91d.jpg")
time.sleep(2)
# 上传（显示等待）
upload=WebDriverWait(driver,20,0.5).until(EC.presence_of_element_located((By.CLASS_NAME,'upload-pic')))
upload.send_keys(r'C:\Users\lenovo\Pictures\Screenshots\73ba71d0b11d3b5d1ccd42391d99e91d.jpg')
driver.quit()
print(upload.get_attribute('value'))
driver.implicitly_wait(10)



upload=WebDriverWait(driver,20,0.5).until(EC.presence_of_element_located((By.CLASS_NAME,'upload-pic')))

